<template>
	<div class="app-container">
		<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="100px">
			<el-form-item label="任务编号" prop="taskNum">
				<el-input placeholder="请输入任务编号" v-model="queryParams.taskNum" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="任务名称" prop="taskName">
				<el-input v-model="queryParams.taskName" placeholder="请输入任务名称" clearable @keyup.enter="handleQuery" />
			</el-form-item>
			<el-form-item label="省" prop="province">
				<el-select v-model="queryParams.province" placeholder="请选择省" @change="chooseProvince" clearable value-key="id">
					<el-option v-for="item in provinceData" :key="item.id" :label="item.name" :value="item">
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="市" prop="city">
				<el-select v-model="queryParams.city" placeholder="请选择市" @change="chooseCity" clearable value-key="id">
					<el-option v-for="item in cityData" :key="item.id" :label="item.name" :value="item">
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="区/县" prop="area">
				<el-select v-model="queryParams.area" placeholder="请选择县" @change="choosearea" clearable value-key="id">
					<el-option v-for="item in areaData" :key="item.id" :label="item.name" :value="item">
					</el-option>
				</el-select>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" @click="handleQuery">查询</el-button>
				<el-button @click="resetQuery">重置</el-button>
			</el-form-item>
		</el-form>
		<!--<el-row :gutter="10" class="mb8">
			<el-col :span="1.5">
				<el-button plain icon="Delete" :disabled="multiple" @click="handleDelete">删除</el-button>
			</el-col>
		</el-row>-->
		<!-- container表格区域 -->
		<el-table :data="listData" v-loading="loading" row-key="id" ref="tableRef" stripe
			@selection-change="handleSelectionChange">
			<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
			<el-table-column label="任务编号" align="center" prop="taskNum" />
			<el-table-column label="任务名称" align="center" prop="taskName">
				<template #default="scope">
					<span @click="handleDetil(scope.row.taskId)" style="color: #409eff">{{
						scope.row.taskName
					}}</span>
				</template>
			</el-table-column>
			<el-table-column label="使用模型" align="center" prop="modelType">
				<template #default="scope">
					<div v-if="scope.row.modelType == 1">层次分析法模型</div>
					<div v-if="scope.row.modelType == 2">黄土高原模型</div>
					<div v-if="scope.row.modelType == 3">指数模型</div>
					<div v-if="scope.row.modelType == 4">逻辑斯蒂模型</div>
					<div v-if="scope.row.modelType == 5">Newmark模型</div>
				</template>
			</el-table-column>
			<el-table-column label="任务地区" align="center" prop="taskDistrict" show-overflow-tooltip />
			<el-table-column label="操作" align="center" width="200px" class-name="small-padding fixed-width">
				<template #default="scope">
					<el-button type="text" @click="analysis(scope.row)">评估</el-button>
				</template>
			</el-table-column>
		</el-table>
		<pagination v-show="total > 0" :total="total" v-model:page="queryParams.page" v-model:limit="queryParams.rows"
			@pagination="getList" />
		<!--新建/修改任务的弹出框 -->
		<el-dialog v-model="openAdd" :title="title" width="800px" append-to-body>
			<div v-loading="viewLoading">
				<p class="dialogTitle">查看任务</p>
				<table class="addTask">
					<tr>
						<td colspan="2">
							<span class="label">任务编号：</span><span>{{ queryParamsAdd.taskNum }}</span>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<span class="label">任务名称：</span><span>{{ queryParamsAdd.taskName }}</span>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<span class="label">面积（平方公里）：</span>
							<!--<span>{{ queryParamsAdd.area }}</span>-->
							<el-link type="primary" :underline="false" @click="selectFeatureAll">查看</el-link>
						</td>
					</tr>
					<!--<tr>
          <td colspan="2">
            <span class="label">任务区域：</span><span class="init-taskDivSpan">{{ queryParamsAdd.taskRegion.substr(0,358) }}</span>
          </td>
        </tr>-->
					<tr>
						<td colspan="2">
							<span class="label">任务地区：</span><span class="init-taskDivSpan" v-if="title == '新建任务'">{{ taskDistrictName
							}}</span><span class="init-taskDivSpan" v-else>{{
	queryParamsAdd.taskDistrict
}}</span>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<el-form :model="queryParamsAdd" :inline="true" label-width="140px">
								<el-form-item label="灾害类型：" prop="disasterType" style="width: 90%">
									<el-checkbox-group v-model="queryParamsAdd.disasterType">
										<el-checkbox label="1" :disabled="dzhpIsEdit">地震滑坡</el-checkbox>
										<el-checkbox label="2" :disabled="styhIsEdit">砂土液化</el-checkbox>
										<el-checkbox label="3" :disabled="rtzxIsEdit">软土震陷</el-checkbox>
									</el-checkbox-group>
								</el-form-item>
							</el-form>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<span class="label">评估人：</span><span>{{ queryParamsAdd.createUserName }}</span>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<span class="label">任务状态：</span>
							<span v-if="queryParamsAdd.taskStatus == '1'">进行中</span>
							<span v-if="queryParamsAdd.taskStatus == '2'">审核中</span>
							<span v-if="queryParamsAdd.taskStatus == '3'">退回修改</span>
							<span v-if="queryParamsAdd.taskStatus == '4'">已完成</span>
						</td>
					</tr>
				</table>
			</div>
			<template #footer>

				<el-button @click="cancelAdd">取 消</el-button>

			</template>
		</el-dialog>
		<!-- 查看弹出框 -->
		<el-dialog v-model="openDetail" title="查看任务" width="900px">
			<p class="dialogTitle">{{ title }}</p>
			<table class="addTask">
				<tr>
					<td>
						<span class="label">任务编号：</span><span>{{ queryParamsAdd.taskNum }}</span>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<el-form :model="queryParamsAdd" :rules="rules" ref="rulesFormAdd" :inline="true" label-width="140px">
							<el-form-item label="任务名称：" prop="taskName" style="width: 90%">
								<el-input placeholder="请输入任务名称" clearable v-model="queryParamsAdd.taskName" />
							</el-form-item>
						</el-form>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<span class="label">面积（平方公里）：</span>
						<!--<span>{{ queryParamsAdd.taskArea }}</span>-->
						<el-link type="primary" :underline="false" @click="selectFeatureAll">查看</el-link>
					</td>
				</tr>
				<!--<tr>
						<td colspan="2">
							<span class="label">任务区域：</span><span class="init-taskDivSpan">{{ queryParamsAdd.taskRegion.substr(0,358) }}</span>
						</td>
					</tr>-->
				<tr>
					<td colspan="2">
						<span class="label">任务地区：</span><span class="init-taskDivSpan" v-if="title == '新建任务'">{{ taskDistrictName
						}}</span><span class="init-taskDivSpan" v-else>{{
	queryParamsAdd.taskDistrict
}}</span>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<span class="label">灾害类型：</span>
						<span>
							<el-checkbox-group v-model="checkList">
								<el-checkbox label="地震滑坡"></el-checkbox>
								<el-checkbox label="砂土液化"></el-checkbox>
								<el-checkbox label="软土震陷"></el-checkbox>
							</el-checkbox-group>
						</span>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<span class="label">评估人：</span><span>{{ queryParamsAdd.taskArea }}</span>
					</td>
				</tr>
			</table>
		</el-dialog>
		<el-dialog v-model="openMJ" title="面积查看" width="500px" append-to-body>
			<el-table id="tab" :data="tableData" style="text-align: center">
				<el-table-column prop="tdaName" label="区域" />
				<el-table-column prop="tdaArea" label="面积（平方公里）" />
			</el-table>
			<template #footer>
				<span class="dialog-footer">
					<el-button @click="exportExcel('tab')">导 出</el-button>
				</span>
			</template>
		</el-dialog>
		<!-- 选择模型弹出框 -->
		<el-dialog v-model="selectDetail" title="选择模型" width="900px" append-to-body>
			<p></p>
			<el-tabs :tab-position="tabPosition" v-model="activeName" @tab-click="handleClick">
				<el-tab-pane label="层次分析法模型" name="first">
					<el-row>
						<el-col :span="6" class="tab-title">
							模型描述
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p style="text-indent: 2em;">
								层次分析法（Analytical Hierarchy
								Process，APH）是一种将定性分析和定量分析相结合的系统分析方法。它适用于多准则、多目标的复杂问题的决策分析，可以将决策者对复杂系统的决策思维过程实行数量化，为选出最优决策提供依据。
							</p>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							具体步骤
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p>
								1、建立层次结构模型：综合分析系统所涉及的目标、范围、准则，约束条件，确定综合评价体系中各因素之间的关系，并根据指标的隶属关系进行上下分层排列，形成危险性综合评价体系层次结构。将问题中的各个要素划分为不同的层次结构，以框架结构说明各层次之间的从属关系。
							</p>
							<p>2、构建判断矩阵：分析每一层的因素相对于上一层次某因素的单排序情况，对一系列成对因素进行量化判断比较，并写成矩阵形式，构成判断矩阵。</p>
							<p>3、归一化权重的计算以及判断矩阵的一致性检验：对上述判断矩阵进行计算，得出矩阵的最大特征值以及相对应的特征向量，将得到的特征向量进行归一化处理后得到归一化权重，对判断矩阵进行一致性检验，以确保组合排序的可靠性。
							</p>
							<p>4、评价单元危险性指数：根据各判断矩阵矩阵所计算的归一化权重，利用多因子加权叠加方法，分别计算各评价单元危险性指数。</p>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							数据使用
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p>
								所需数据包括坡度、地层岩性（或工程地质岩组归并结果）、活断层、道路、水系、气候、地震动峰值加速度。
							</p>
						</el-col>
					</el-row>
				</el-tab-pane>
				<el-tab-pane label="黄土高原模型" name="fourth">
					<el-row>
						<el-col :span="6" class="tab-title">
							模型描述
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p style="text-indent: 2em;">
								黄土高原模型适用于黄土高原地区地震滑坡危险性评估，该模型是利用层次分析法（AHP）确定各影响因子权重，对各因子进行分级赋值、加权叠加分析，进而建立黄土滑坡指数模型，用以评价不同超越概率下黄土发育地区地震滑坡危险性。
							</p>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							算法公式
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p>
								滑坡指数=a×地震动因子+b×地貌因子+c×地层时代因子+d×降雨量因子+e×天然密度因子+f×坡度因子其中：a、b、c、d、e、f为各影响因子权重系数。各影响因子赋值见表。
							</p>

							<p>1、用AHP方法计算权重系数，黄土高原滑坡区划的影响因子及权重系数如下：</p>
							<table align="center" style="width: 100%;border-collapse: collapse;">
								<tr>
									<td align="center">地震动峰值加速度(g)</td>
									<td align="center">地貌</td>
									<td align="center">地层时代</td>
									<td align="center">降雨量(mm)</td>
									<td align="center">坡度(°)</td>
									<td align="center">天然密度(g/m3)</td>
								</tr>
								<tr>
									<td align="center">0.3834</td>
									<td align="center">0.2734</td>
									<td align="center">0.0599</td>
									<td align="center">0.0878</td>
									<td align="center">0.1543</td>
									<td align="center">0.0412</td>
								</tr>

							</table>

							<p>2、根据影响因子赋值表来进行因子加权叠加分析，生成滑坡指数图：</p>
							<table align="center" style="width: 100%;border-collapse: collapse;">
								<tr>
									<td align="center">影响因子</td>
									<td align="center">分类</td>
									<td align="center">赋值</td>
								</tr>
								<tr>
									<td align="center" rowspan="6">地震动峰值加速度(g)</td>
									<td align="center">≥0.6</td>
									<td align="center">6</td>
								</tr>
								<tr>
									<td align="center">[0.4,0.6)</td>
									<td align="center">5</td>
								</tr>
								<tr>
									<td align="center">[0.25,0.4)</td>
									<td align="center">4</td>
								</tr>
								<tr>
									<td align="center">[0.15,0.25)</td>
									<td align="center">3</td>
								</tr>
								<tr>
									<td align="center">[0.05,0.15)</td>
									<td align="center">2</td>
								</tr>
								<tr>
									<td align="center">＜0.15</td>
									<td align="center">1</td>
								</tr>
								<tr>
									<td align="center" rowspan="2">地貌</td>
									<td align="center">源、阶地</td>
									<td align="center">1</td>
								</tr>
								<tr>
									<td align="center">梁、峁</td>
									<td align="center">4</td>
								</tr>
								<tr>
									<td align="center" rowspan="3">地层时代</td>
									<td align="center">Q3、 Q4</td>
									<td align="center">5</td>
								</tr>
								<tr>
									<td align="center">Q2</td>
									<td align="center">3</td>
								</tr>
								<tr>
									<td align="center">Q1</td>
									<td align="center">1</td>
								</tr>
								<tr>
									<td align="center" rowspan="6">降雨量(mm)</td>
									<td align="center">≥600</td>
									<td align="center">6</td>
								</tr>
								<tr>
									<td align="center">[500,600)</td>
									<td align="center">5</td>
								</tr>
								<tr>
									<td align="center">[400,500)</td>
									<td align="center">4</td>
								</tr>
								<tr>
									<td align="center">[300,400)</td>
									<td align="center">3</td>
								</tr>
								<tr>
									<td align="center">[200,300)</td>
									<td align="center">2</td>
								</tr>
								<tr>
									<td align="center">＜200</td>
									<td align="center">1</td>
								</tr>
								<tr>
									<td align="center" rowspan="6">坡度(°)</td>
									<td align="center">≥30</td>
									<td align="center">6</td>
								</tr>
								<tr>
									<td align="center">[24,30)</td>
									<td align="center">5</td>
								</tr>
								<tr>
									<td align="center">[18,24)</td>
									<td align="center">4</td>
								</tr>
								<tr>
									<td align="center">[12,18)</td>
									<td align="center">3</td>
								</tr>
								<tr>
									<td align="center">[5,12)</td>
									<td align="center">2</td>
								</tr>
								<tr>
									<td align="center">＜5</td>
									<td align="center">1</td>
								</tr>
								<tr>
									<td align="center" rowspan="6">天然密度(g/m3)</td>
									<td align="center">＜1.4</td>
									<td align="center">6</td>
								</tr>
								<tr>
									<td align="center">[1.4,1.5)</td>
									<td align="center">5</td>
								</tr>
								<tr>
									<td align="center">[1.5,1.6)</td>
									<td align="center">4</td>
								</tr>
								<tr>
									<td align="center">[1.6,1.7)</td>
									<td align="center">3</td>
								</tr>
								<tr>
									<td align="center">[1.7,1.8)</td>
									<td align="center">2</td>
								</tr>
								<tr>
									<td align="center">≥1.8</td>
									<td align="center">1</td>
								</tr>
							</table>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							数据使用
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p>
								所需数据包括坡度、地层岩性、地貌、天然密度、气候、地震动峰值加速度。
							</p>
						</el-col>
					</el-row>
				</el-tab-pane>
				<el-tab-pane label="指数模型" name="second">
					<el-row>
						<el-col :span="6" class="tab-title">
							模型描述
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p style="text-indent: 2em;">
								滑坡危险性评价指数模型是指基于坡度和烈度因子与地震滑坡密度关系，针对不同坡度段以指数函数的形式建立模型，拟合滑坡密度，用以评估地震滑坡危险性的方法。
							</p>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							算法公式
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p>
								1、将坡度分为≤1°、1° ～ 3°、3° ～ 7°、7° ～ 10°、10° ～ 15°、15° ～ 20°、20° ～ 25°、25° ～ 30°、30° ～ 35°、35° ～ 40°、40° ～
								45°、45° ～ 50°、 ＞ 50°共 13 个等级。
							</p>
							<p>2、利用指数模型分别计算任务区域不同烈度条件下，不同坡度范围内，滑坡密度。</p>
							<p>3、按照地震滑坡密度等级划分，对任务区滑坡危险性进行综合评价。</p>
							<p>不同坡度下的地震滑坡密度指数模型：</p>
							<table align="center" style="width: 100%;border-collapse: collapse;">
								<tr>
									<td align="center">坡度范围</td>
									<td align="center" colspan="2">指数模型</td>
								</tr>
								<tr>
									<td align="center">≤1°</td>
									<td align="center">y=2E-10e<sup>1.5508x</sup></td>
									<td align="center">R<sup>2</sup>=0.1664</td>
								</tr>
								<tr>
									<td align="center">1°-3°</td>
									<td align="center">y=2E-07e<sup>1.2596x</sup></td>
									<td align="center">R<sup>2</sup>=0.9439</td>
								</tr>
								<tr>
									<td align="center">3°-7°</td>
									<td align="center">y=3E-07e<sup>1.2683x</sup></td>
									<td align="center">R<sup>2</sup>=0.9684</td>
								</tr>
								<tr>
									<td align="center">7°-10°</td>
									<td align="center">y=1E-06e<sup>1.1574x</sup></td>
									<td align="center">R<sup>2</sup>=0.9555</td>
								</tr>
								<tr>
									<td align="center">10°-15°</td>
									<td align="center">y=2E-06e<sup>1.1368x</sup></td>
									<td align="center">R<sup>2</sup>=0.9525</td>
								</tr>
								<tr>
									<td align="center">15°-20°</td>
									<td align="center">y=3E-06e<sup>1.0869x</sup></td>
									<td align="center">R<sup>2</sup>=0.9524</td>
								</tr>
								<tr>
									<td align="center">20°-25°</td>
									<td align="center">y=6E-06e<sup>1.0558x</sup></td>
									<td align="center">R<sup>2</sup>=0.9406</td>
								</tr>
								<tr>
									<td align="center">25°-30°</td>
									<td align="center">y=1E-05e<sup>1.013x</sup></td>
									<td align="center">R<sup>2</sup>=0.952</td>
								</tr>
								<tr>
									<td align="center">30°-35°</td>
									<td align="center">y=2E-05e<sup>0.9709x</sup></td>
									<td align="center">R<sup>2</sup>=0.9518</td>
								</tr>
								<tr>
									<td align="center">35°-40°</td>
									<td align="center">y=4E-05e<sup>0.9081x</sup></td>
									<td align="center">R<sup>2</sup>=0.9617</td>
								</tr>
								<tr>
									<td align="center">40°-45°</td>
									<td align="center">y=6E-05e<sup>0.8946x</sup></td>
									<td align="center">R<sup>2</sup>=0.9497</td>
								</tr>
								<tr>
									<td align="center">45°-50°</td>
									<td align="center">y=9E-05e<sup>0.8621x</sup></td>
									<td align="center">R<sup>2</sup>=0.9388</td>
								</tr>
								<tr>
									<td align="center">>50°</td>
									<td align="center">y=3E-05e<sup>0.9743x</sup></td>
									<td align="center">R<sup>2</sup>=0.9071</td>
								</tr>
							</table>

							<p>地震滑坡危险等级划分：</p>
							<table align="center" style="width: 100%;border-collapse: collapse;">
								<tr>
									<td align="center" width="50px">序号</td>
									<td align="center" width="80px">地震滑坡危险等级</td>
									<td align="center" width="80px">综合评价</td>
									<td align="center" width="80px">滑坡密度值范围</td>
									<td align="center">滑坡现象</td>
								</tr>
								<tr>
									<td align="center">1</td>
									<td align="center">一级</td>
									<td align="center">几无</td>
									<td align="center">（0-0.01]</td>
									<td align="center">无滑坡现象</td>
								</tr>
								<tr>
									<td align="center">2</td>
									<td align="center">二级</td>
									<td align="center">轻微</td>
									<td align="center">（0.01-0.03]</td>
									<td>有些零星的落石、塌方现象，个别地方可能造成短暂的交通破坏，地震滑坡造成人畜伤亡的可能性很低，地震滑坡影响的道路、河流、电力、通信等设施在简易处置后可以很快恢复使用。</td>
								</tr>
								<tr>
									<td align="center">3</td>
									<td align="center">三级</td>
									<td align="center">中等</td>
									<td align="center">（0.03-0.09]</td>
									<td>有可能造成交通破坏和房屋受损，有出现地震滑坡造成人畜伤亡的可能，受地震滑坡影响的道路、河流、生命线工程等可以快速抢诵通常情况下1天内能大部分恢复使用。</td>
								</tr>
								<tr>
									<td align="center">4</td>
									<td align="center">四级</td>
									<td align="center">严重</td>
									<td align="center">（0.09-0.27]</td>
									<td>
										造成严重的交通中断断、房屋受损的较大可能性，甚至出现滑坡造成大量人员死亡的可能，受地震滑坡影响，可能需要数天的抢修才好基本恢复交通，在降水丰富和河流密集地区出现地震滑坡一堰塞湖、地震滑坡一泥石流等次生灾害链的可能性也较大，有关部门应该根据地震影响区域人口密度等因素考虑是否提高启动的应急响应等级。
									</td>
								</tr>
								<tr>
									<td align="center">5</td>
									<td align="center">五级</td>
									<td align="center">特重</td>
									<td align="center">大于0.27</td>
									<td>可能造成特别严重的交通中断、房屋受损和人员伤亡，在降水丰富和河流密集地区出现地震滑坡一堰塞湖、地震滑坡一泥石流等次生灾害链的可能性特别大，地震滑坡造成的
										交通、河流、电力、通信等破坏往往需要十余天甚至数十天才能修复，有关部门应该考虑提高启动的应急响应等级。</td>
								</tr>
							</table>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							数据使用
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p>
								所需数据为坡度。
							</p>
						</el-col>
					</el-row>
				</el-tab-pane>
				<el-tab-pane label="逻辑斯蒂模型" name="third">
					<el-row>
						<el-col :span="6" class="tab-title">
							模型描述
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p style="text-indent: 2em;">
								逻辑斯蒂模型是指基于坡度和烈度因子与地震滑坡密度关系，针对不同坡度段以逻辑斯蒂函数建立模型，拟合滑坡密度，用以评估地震滑坡危险性的方法。
							</p>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							算法公式
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p>
								1、将坡度分为≤1°、1° ～ 3°、3° ～ 7°、7° ～ 10°、10° ～ 15°、15° ～ 20°、20° ～ 25°、25° ～ 30°、30° ～ 35°、35° ～ 40°、40° ～
								45°、45° ～ 50°、 ＞ 50°共 13 个等级。
							</p>
							<p>2、利用逻辑斯蒂模型分别计算任务区域不同烈度条件下，不同坡度范围内，滑坡密度。</p>
							<p>3、按照地震滑坡密度等级划分，对任务区滑坡危险性进行综合评价。</p>
							<p>不同坡度下的地震滑坡密度逻辑斯蒂模型：</p>
							<table align="center" style="width: 100%;border-collapse: collapse;">
								<tr>
									<td align="center">坡度范围</td>
									<td align="center" colspan="2">逻辑斯蒂模型</td>
								</tr>
								<tr>
									<td align="center">≤1°</td>
									<td align="center">Y=1/(1+exp(8.22178-0.34329x))</td>
									<td align="center">OR=1.409577</td>
								</tr>
								<tr>
									<td align="center">1°-3°</td>
									<td align="center">Y=1/(1+exp(9.27905-0.63448x))</td>
									<td align="center">OR=1.884096</td>
								</tr>
								<tr>
									<td align="center">3°-7°</td>
									<td align="center">Y=1/(1+exp(11.3983-0.916239x))</td>
									<td align="center">OR=2.499872</td>
								</tr>
								<tr>
									<td align="center">7°-10°</td>
									<td align="center">Y=1/(1+exp(10.6025-0.849128x))</td>
									<td align="center">OR=2.337608</td>
								</tr>
								<tr>
									<td align="center">10°-15°</td>
									<td align="center">Y=1/(1+exp(10.3517-0.852482x))</td>
									<td align="center">OR=2.345462</td>
								</tr>
								<tr>
									<td align="center">15°-20°</td>
									<td align="center">Y=1/(1+exp(10.0078-0.847624x))</td>
									<td align="center">OR=2.334094</td>
								</tr>
								<tr>
									<td align="center">20°-25°</td>
									<td align="center">Y=1/(1+exp(9.19721-0.789875x))</td>
									<td align="center">OR=2.203122</td>
								</tr>
								<tr>
									<td align="center">25°-30°</td>
									<td align="center">Y=1/(1+exp(9.68142-0.852073x))</td>
									<td align="center">OR=2344501</td>
								</tr>
								<tr>
									<td align="center">30°-35°</td>
									<td align="center">Y=1/(1+exp(9.65106-0.8847x))</td>
									<td align="center">OR=2.422259</td>
								</tr>
								<tr>
									<td align="center">35°-40°</td>
									<td align="center">Y=1/(1+exp(101154-0.968573x))</td>
									<td align="center">OR=2.634182</td>
								</tr>
								<tr>
									<td align="center">40°-45°</td>
									<td align="center">Y=1/(1+exp(10.1773-1.012792x))</td>
									<td align="center">OR=2.753278</td>
								</tr>
								<tr>
									<td align="center">45°-50°</td>
									<td align="center">Y=1/(1+exp(9.89683-1.007739x))</td>
									<td align="center">OR=2.939400</td>
								</tr>
								<tr>
									<td align="center">＞50°</td>
									<td align="center">Y=1/(1+exp(9.80003-0.989653x))</td>
									<td align="center">OR=2.690301</td>
								</tr>
							</table>

							<p>地震滑坡危险等级划分：</p>
							<table align="center" style="width: 100%;border-collapse: collapse;">
								<tr>
									<td align="center" width="50px">序号</td>
									<td align="center" width="80px">地震滑坡危险等级</td>
									<td align="center" width="80px">综合评价</td>
									<td align="center" width="80px">滑坡密度值范围</td>
									<td align="center">滑坡现象</td>
								</tr>
								<tr>
									<td align="center">1</td>
									<td align="center">一级</td>
									<td align="center">几无</td>
									<td align="center">（0-0.01]</td>
									<td align="center">无滑坡现象</td>
								</tr>
								<tr>
									<td align="center">2</td>
									<td align="center">二级</td>
									<td align="center">轻微</td>
									<td align="center">（0.01-0.03]</td>
									<td>有些零星的落石、塌方现象，个别地方可能造成短暂的交通破坏，地震滑坡造成人畜伤亡的可能性很低，地震滑坡影响的道路、河流、电力、通信等设施在简易处置后可以很快恢复使用。</td>
								</tr>
								<tr>
									<td align="center">3</td>
									<td align="center">三级</td>
									<td align="center">中等</td>
									<td align="center">（0.03-0.09]</td>
									<td>有可能造成交通破坏和房屋受损，有出现地震滑坡造成人畜伤亡的可能，受地震滑坡影响的道路、河流、生命线工程等可以快速抢诵通常情况下1天内能大部分恢复使用。</td>
								</tr>
								<tr>
									<td align="center">4</td>
									<td align="center">四级</td>
									<td align="center">严重</td>
									<td align="center">（0.09-0.27]</td>
									<td>
										造成严重的交通中断断、房屋受损的较大可能性，甚至出现滑坡造成大量人员死亡的可能，受地震滑坡影响，可能需要数天的抢修才好基本恢复交通，在降水丰富和河流密集地区出现地震滑坡一堰塞湖、地震滑坡一泥石流等次生灾害链的可能性也较大，有关部门应该根据地震影响区域人口密度等因素考虑是否提高启动的应急响应等级。
									</td>
								</tr>
								<tr>
									<td align="center">5</td>
									<td align="center">五级</td>
									<td align="center">特重</td>
									<td align="center">大于0.27</td>
									<td>可能造成特别严重的交通中断、房屋受损和人员伤亡，在降水丰富和河流密集地区出现地震滑坡一堰塞湖、地震滑坡一泥石流等次生灾害链的可能性特别大，地震滑坡造成的
										交通、河流、电力、通信等破坏往往需要十余天甚至数十天才能修复，有关部门应该考虑提高启动的应急响应等级。</td>
								</tr>
							</table>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							数据使用
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p>
								所需数据为坡度。
							</p>
						</el-col>
					</el-row>
				</el-tab-pane>
				<el-tab-pane label="Newmark模型" name="fifth">
					<el-row>
						<el-col :span="6" class="tab-title">
							模型描述
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p style="text-indent: 2em;">
								Newmark模型是基于有限滑动位移模型，通过计算滑体在地震动加速度作用过程中累积的永久位移来评价斜坡稳定性的方法。
							</p>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							算法公式
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p style="text-indent: 2em;">
								Newmark 位移的区域危险性评估主要包括：
							</p>
							<p>（1）斜坡稳定系数 Fs计算：通过斜坡几何属性和岩土体属性，计算坡体的稳定系数 Fs：</p>
							<img style="margin-left: 100px;" src="@/assets/images/u4393.png">
							<!--<p><span style="font-size: 16px;font-weight: bold;">Fs = <sub style="position: absolute;top: 72px;left: 80px;">c´</sub>————<sup style="position: absolute;top: 95px;left: 80px;">γ t sinα</sup>
								+
							</span></p>-->
							<p><img style="margin-left: 10px;vertical-align: middle;" src="@/assets/images/u4369.png">
								为常数：<img style="vertical-align: middle;" src="@/assets/images/u4413.png"> ，t为常数，根据坡度不同取值不同，见下表，m值为用户输入的参数。
							</p>
							<table align="center" style="width: 100%;border-collapse: collapse;">
								<tr>
									<td align="center">坡度（°）</td>
									<td align="center">岩土体厚度（m）</td>
								</tr>
								<tr>
									<td align="center">&lt;30</td>
									<td align="center">5</td>
								</tr>
								<tr>
									<td align="center">30~45</td>
									<td align="center">4</td>
								</tr>
								<tr>
									<td align="center">45~60</td>
									<td align="center">3</td>
								</tr>
								<tr>
									<td align="center">&gt;60</td>
									<td align="center">2</td>
								</tr>
							</table>
							<!-- <p><img  src="@/assets/images/u4370.png"></p> -->
							<p>有效内聚力<img style="vertical-align: middle;" src="@/assets/images/u4373.png">
								，内摩擦角<img style="vertical-align: middle;" src="@/assets/images/u4374.png">
								，岩土体重度<img style="vertical-align: middle;" src="@/assets/images/u4375.png">
								，根据区域范围内基础数据地层岩性进行工程地质岩组归类后输入分组后每组（坚硬岩组、较硬岩组、较软岩组、软岩组、极软岩组）岩性对应的有效内聚力
								<img style="vertical-align: middle;" src="@/assets/images/u4373.png">
								，内摩擦角<img style="vertical-align: middle;" src="@/assets/images/u4374.png">
								值，岩土体重度<img style="vertical-align: middle;" src="@/assets/images/u4375.png">。
							</p>
							<p>2、临界加速度<img style="vertical-align: middle;" src="@/assets/images/u4381.png">
								计算：利用无限斜坡法计算稳定系数 Fs 间接推导得到临界加速度<img style="vertical-align: middle;" src="@/assets/images/u4381.png">。</p>
							<p><img style="margin-left: 100px;" src="@/assets/images/u4383.png"></p>
							<p>其中，g为重力加速度，α滑动面倾角，在式中近似按斜坡坡角（坡度）取值。</p>
							<p>3、Newmark累计位移计算：把临界加速度比作为回归方程变量进行地震边坡永久位移计算。</p>
							<p style="margin-left: 20px;">公式1：<img style="margin-left: 10px;vertical-align: middle;"
									src="@/assets/images/u4386.png"></p>
							<p style="margin-left: 20px;">公式2：<img style="margin-left: 10px;vertical-align: middle;"
									src="@/assets/images/u4389.png"></p>
							<p style="margin-left: 20px;">公式3：<img style="margin-left: 10px;vertical-align: middle;"
									src="@/assets/images/u4391.png"></p>
							<p>4、地震滑坡危险性评估：基于 Newmark 位移图基础之上，利用边坡失稳概率函数进行计算，从而得到评估区滑坡危险性指数分布图。</p>
							<p><img style="margin-left: 100px;" src="@/assets/images/u4392.png"></p>
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="6" class="tab-title">
							数据使用
						</el-col>
					</el-row>
					<el-row>
						<el-col :span="22" :offset="1">
							<p>
								所需数据包括坡度、地层岩性（或工程地质岩组归并结果）、地震动峰值加速度。
							</p>
						</el-col>
					</el-row>
				</el-tab-pane>
			</el-tabs>
			<template #footer>
				<span class="dialog-footer">
					<el-button type="primary" @click="selectModel">选 择</el-button>
				</span>
			</template>
		</el-dialog>
	</div>
</template>
<script setup name="assess">
import { getProvince, getChildArea } from "@/api/system/division";
import { getProvinces, getYear, getDistrict } from "@/utils/group.js";
import {
	getTask,
	delTask,
	updateTask,
	addSubTask,
	addTask,
	detailTask,
	groupFp,
	getTaskBian,
	getSubTaskBian,
	getSubTask,
	getAllTaskList,
	viewTaskArea,
} from "@/api/slideAssess/analysisAssess";
import FileSaver from "file-saver";
import * as XLSX from "xlsx";

const router = useRouter();
const { proxy } = getCurrentInstance();
const taskDistrictName = ref("");
const tabPosition = ref("left");
const modelName = ref("first");
const modelLabel = ref("");
const taskDistrict = ref("");
const taskId = ref("");
const openMJ = ref(false);
const ids = ref([]);
const checkList = ref([]);
const single = ref(true);
const selectDetail = ref(false);
const multiple = ref(true);
const loading = ref(true);
const provinceData = ref([]); //省
const cityData = ref([]); //市
const areaData = ref([]); //区、县
const openAdd = ref(false);
const dzhpIsEdit = ref(false);
const styhIsEdit = ref(false);
const rtzxIsEdit = ref(false);
const title = ref("");
const activeName = ref("first");
const openDetail = ref(false);
const total = ref(0);
const numAdd = ref(2);
const delFlag = ref(false);
const rules = reactive({
	taskDistrict: [{
		required: true,
		message: "请选择地区",
		trigger: "change"
	}],
	taskYear: [{
		required: true,
		message: "请选择年份",
		trigger: "change"
	}],
	taskName: [{
		required: true,
		message: "请输入任务名称",
		trigger: "blur"
	}],
});
const data = reactive({
	selectProvince: [],
	listData: [],
	tableData: [],
	queryParams: {
		page: 1,
		rows: 10,
		taskNum: "",
		taskName: "",
		province: "",
		city: "",
		area: "",
	},
	queryParamsAdd: {
		taskYear: "",
		taskNum: "",
		taskName: "",
		taskArea: "",
		taskRegion: "",
		parentdistrictList: [],
		taskDistrict: "",
		groupName: "",
		groupLeader: "",
		groupId: "",
		groupLeaderId: "",
		regionCodes: "" //地图行政区划code,code字符串
	},
	subDataPage: {
		page: 1,
		rows: 10,
	},
});

let {
	queryParams,
	listData,
	tableData,
	queryParamsAdd,
} = toRefs(data);

//评估
function analysis(row) {
	if (row.modelType == null || row.modelType == "") {
		selectDetail.value = true;
	} else {
		if (row.modelType == "1") {
			//层次分析法
			router.push({
				path: "/analysisAssess/levelAnalyse",
				query: {
					taskId: row.taskId,
					modelType: row.modelType,
					taskDistrict: row.taskDistrict,
					metaTitle: "层次分析法模型"
				}
			})

		} else if (row.modelType == "2") {
			//黄土高原
			router.push({
				path: "/analysisAssess/loessPlateau",
				query: {
					taskId: row.taskId,
					modelType: row.modelType,
					taskDistrict: row.taskDistrict,
					metaTitle: "黄土高原模型"
				}
			})
		} else if (row.modelType == "3") {
			//指数
			router.push({
				path: "/analysisAssess/indexModel",
				query: {
					taskId: row.taskId,
					modelType: row.modelType,
					taskDistrict: row.taskDistrict,
					metaTitle: "指数模型"
				}
			})
		} else if (row.modelType == "4") {
			//逻辑斯蒂
			router.push({
				path: "/analysisAssess/logisti",
				query: {
					taskId: row.taskId,
					modelType: row.modelType,
					taskDistrict: row.taskDistrict,
					metaTitle: "逻辑斯蒂模型"
				}
			})
		} else if (row.modelType == "5") {
			router.push({
				path: "/analysisAssess/newMark",
				query: {
					taskId: row.taskId,
					modelType: row.modelType,
					taskDistrict: row.taskDistrict,
					metaTitle: "newMark模型"
				}
			})
		}

	}
	taskDistrict.value = row.taskDistrict;
	taskId.value = row.taskId;
}
const handleSelectionChange = (selection) => {
	ids.value = selection.map((item) => item.id);
	single.value = selection.length != 1;
	multiple.value = !selection.length;
	selection.forEach((item) => {
		if (item.taskStatus == "3" || item.taskStatus == "2") {
			delFlag.value = false;
		} else {
			delFlag.value = true;
		}
	});
};
/** 搜索按钮操作 */
function handleQuery() {
	queryParams.value.page = 1;
	getList();
}
/** 重置按钮操作 */
function resetQuery() {
	cityData.value = [];
	areaData.value = [];
	proxy.resetForm("queryRef");
	handleQuery();
}
/** 获取省列表 */
function getProvinceData() {
	getProvince().then((response) => {
		provinceData.value = response.data;
	});
}

function chooseProvince(value) {
	queryParams.value.city = null;
	queryParams.value.area = null;
	queryParams.value.province = value.name;
	cityData.value = [];
	areaData.value = [];
	getChildArea(value.id).then((response) => {
		cityData.value = response.data;
	});
	/*provinceData.value.map((item) => {
		//遍历数据
		if (item.id == value.id) {
			if (
				item.name == "北京市" ||
				item.name == "天津市" ||
				item.name == "上海市" ||
				item.name == "重庆市"
			) {
				cityData.value.push(JSON.parse(JSON.stringify(item)));
			} else {
				getChildArea(value.id).then((response) => {
					cityData.value = response.data;
				});
			}
			return;
		}
	});*/
}

function chooseCity(value) {
	queryParams.value.city = value.name;
	queryParams.value.area = null;
	areaData.value = [];
	getChildArea(value.id).then((response) => {
		areaData.value = response.data;
	});
}

function choosearea(value) {
	queryParams.value.area = value.name;
}
/** 获取列表操作 */
function getList() {
	loading.value = true;
	getTask(queryParams.value).then((response) => {
		listData.value = response.data.rows;
		loading.value = false;
		total.value = response.data.total;
	});

}
//选择模型
function selectModel() {
	if (modelName.value == "first") {
		//层次分析法模型
		router.push({
			path: "/analysisAssess/levelAnalyse",
			query: {
				taskId: taskId.value,
				modelType: "1",
				taskDistrict: taskDistrict.value,
				metaTitle: "层次分析法模型"
			}
		})
	}
	if (modelName.value == "second") {
		//指数
		router.push({
			path: "/analysisAssess/indexModel",
			query: {
				taskId: taskId.value,
				modelType: "3",
				taskDistrict: taskDistrict.value,
				metaTitle: modelLabel.value
			}
		})
	}
	if (modelName.value == "third") {
		//逻辑斯的
		router.push({
			path: "/analysisAssess/logisti",
			query: {
				taskId: taskId.value,
				modelType: "4",
				taskDistrict: taskDistrict.value,
				metaTitle: modelLabel.value
			}
		})
	}
	if (modelName.value == "fourth") {
		//黄土高原
		router.push({
			path: "/analysisAssess/loessPlateau",
			query: {
				taskId: taskId.value,
				modelType: "2",
				taskDistrict: taskDistrict.value,
				metaTitle: modelLabel.value
			}
		})
	}
	if (modelName.value == "fifth") {
		//newMark
		router.push({
			path: "/analysisAssess/newMark",
			query: {
				taskId: taskId.value,
				modelType: "5",
				taskDistrict: taskDistrict.value,
				metaTitle: modelLabel.value
			}
		})
	}
}
/** 查看按钮操作 */
const viewLoading = ref(true);
function handleDetil(id) {
	title.value = "查看任务";
	openAdd.value = true;
	dzhpIsEdit.value = true;
	styhIsEdit.value = true;
	rtzxIsEdit.value = true;
	viewLoading.value = true
	detailTask({
		dtId: id
	}).then((response) => {
		viewLoading.value = false
		queryParamsAdd.value = response.data;
		if (response.data.disasterType != "" || response.data.disasterType != null) {
			queryParamsAdd.value.disasterType = response.data.disasterType.split(",");
		} else {
			queryParamsAdd.value.disasterType = [];
		}
	}).catch(() => viewLoading.value = false)
	viewTaskArea({ dtId: id }).then(response => {
		tableData.value = response.data
	})
}
function selectFeatureAll() {
	openMJ.value = true
}
// 定义导出表格触发事件
function exportExcel(tabid) {
	const wb = XLSX.utils.table_to_book(document.querySelector('#' + tabid), {
		raw: true // 如果表格里有数字、日期这些、需要加上raw: true
	});
	/* 获取二进制字符串作为输出 */
	var wbout = XLSX.write(wb, {
		bookType: 'xlsx',
		bookSST: true,
		type: 'array'
	});
	try {
		FileSaver.saveAs(
			// Blob 对象表示一个不可变、原始数据的类文件对象
			new Blob([wbout], { type: 'application/octet-stream' }),
			// 设置导出文件名称
			"面积列表信息.xlsx"
		);
	} catch (e) {
		if (typeof console !== 'undefined') console.log(e, wbout);
	}
	return wbout;
}
function resetAdd() {
	queryParamsAdd.value.taskYear = "";
	queryParamsAdd.value.taskNum = "";
	queryParamsAdd.value.taskName = "";
	queryParamsAdd.value.taskArea = "";
	queryParamsAdd.value.taskRegion = "";
	queryParamsAdd.value.groupName = "";
	queryParamsAdd.value.groupLeader = "";
	queryParamsAdd.value.groupId = "";
	queryParamsAdd.value.groupLeaderId = "";
	queryParamsAdd.value.memberName = "";
	queryParamsAdd.value.expertName = "";
	queryParamsAdd.value.taskDistrict = "";
	numAdd.value = 2;
	proxy.resetForm("rulesFormAdd");
}
// 取消
function cancelAdd() {
	openAdd.value = false;
	resetAdd();
}
//切换标签页
function handleClick(tab, event) {
	modelName.value = tab.props.name;
	modelLabel.value = tab.props.label;
}

getYear();
getList();
getProvinceData();
</script>
<style scoped lang="scss">
.area span.label {
	text-align: right;
	margin-right: 14px;
	display: inline-block;
	color: #606266;
	font-weight: 700;
	width: 30px;
}

.smallHeader {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background-color: #1890ff;
	position: relative;
	color: #fff;
	font-weight: 700;
}

.addTask,
.addSubTask {
	width: 700px;
	margin: 0 auto;

	td {
		width: 350px;
		border: 0px solid #c6c6c6;
	}

	.label {
		text-align: right;
		display: inline-block;
		color: #606266;
		font-weight: 700;
		height: 32px;
		width: 142px;
		padding-right: 14px;
	}
}

h3 {
	color: #333;
	height: 21px;
	font-size: 16px;
	line-height: 21px;
	display: flex;
	align-items: center;
	margin-left: 40px;

	span {
		margin-right: 12px;
		display: inline-block;
		width: 3px;
		height: 16px;
		background: #333;
	}
}

.areaDialog {
	text-align: center;

	.close {
		text-align: right;

		.el-icon {
			color: #606266;
			padding: 20px 0;
			margin-right: 10px;
			right: 0px;
			font-size: 22px;
		}
	}

	width: 320px;
	position: absolute;
	top: 270px;
	left: 320px;
	background: rgba($color: #fff, $alpha: 0.9);
}

.tab-title {
	font-size: 16px;
	font-weight: bold;
	border-left: 4px solid #0D9AFF;
	font-family: PingFangSC-Medium;
	padding-left: 10px;
	margin: 10px 0 10px;
}

table td {
	border: 1px solid #c6c6c6;
}
</style>